if(!conf) {
	conf = {};
}

if(typeof global === 'undefined') {
	global = this;
}
seajs.config({
	debug: false,
	charset : 'utf-8',
	map : [ [ /^(.*\.(?:css|js))(.*)$/i, '$1?' + conf.version ] ],
	base: contextPath + "/widget-src" ,//+ conf.staticURI,
	alias: {
		"juicer": contextPath + "/static/thirdparty/juicer/juicer-min.js",
		// 分页
		"pagination.css": contextPath + "/static/style/pagination.css",
		"jquery.my.js": contextPath + "/static/script/jquery.my.js",
		"utils": contextPath + "/static/script/utils.js",
        // 瀑布流
		"masonry": contextPath + "/static/thirdparty/masonry/masonry.pkgd.min.js",
		"imagesloaded": contextPath + "/static/thirdparty/masonry/imagesloaded.pkgd.min.js",
		//截图工具
		'jcrop.css': contextPath + '/static/thirdparty/Jcrop/jquery.Jcrop.min.css',
		'jcrop.js': contextPath + '/static/thirdparty/Jcrop/jquery.Jcrop.min.js',
		//客户端指纹工具
		'fingerprint2.js': contextPath + '/static/thirdparty/fingerprintjs2/fingerprint2.min.js',
		//coockie
		'cookie.js': contextPath + '/static/thirdparty/jquery.cookie.js',
		'plupload': contextPath + '/static/thirdparty/plupload-2.1.8/js/plupload.full.min.js',
		'plupload-dev': contextPath + '/static/thirdparty/plupload-2.1.8/js/plupload.dev.js',
		'moxie-dev': contextPath + '/static/thirdparty/plupload-2.1.8/js/moxie.js',
		'qiniu-sdk': contextPath + '/static/thirdparty/qiniu/src/qiniu.min.js',
		'qiniu-sdk-dev': contextPath + '/static/thirdparty/qiniu/src/qiniu.js',
		'spark-md5': contextPath + '/static/thirdparty/spark/spark-md5.min.js',
		'jwplayer' : contextPath + '/static/thirdparty/jwplayer/jwplayer.js',
		'jwplayer-html5' : contextPath + '/static/thirdparty/jwplayer/jwplayer.html5.js'
	}
});
//define('ui.chosen', ['chosen.css', 'chosen.js'], function(require, exports) {
//	return global.jQuery;
//});

//顺序加载配置
var seajsQueueLoadConf = {
};
//使用方式：seajsQueue().use(xx).use(xx).run(function(){ xxx });
var seajsQueue = function() {
	return (function() {
		var queue = [];
		return {
			use : function(p) {
				// 按顺序添加一个模块（名称）
				if(seajsQueueLoadConf[p]) {
					queue = queue.concat(seajsQueueLoadConf[p]);
				}else{
					queue.push(p);
				}
				return this;
			},
			run : function(callback) {
				// 使用递归的方式，从队列中依次加载模块
				var go = function() {
					if (queue.length == 0) {
						callback();
					} else {
						var p = queue.shift();
						seajs.use(p, go);
					}
				};
				go();
			}
		};
	})();
};